package Others.DesignPattern.AbstractFactoryPattern.Original;

import Others.DesignPattern.AbstractFactoryPattern.Original.Object2.*;

public class main2 {
    public static void main(String[] args) {
       //试着实现一下--部门的添加吧！
        User user = new User("1");
        Department department = new Department("1");

        IUser MySQLUser = new MySQLUser();
        MySQLUser.Insert(user);
        MySQLUser.GetUser("1");
        System.out.println();
        IDepartment MySQLDepartment = new MySQLDepartment();
        MySQLDepartment.GetUser("1");
        MySQLDepartment.Insert(department);

        System.out.println();

        IUser OracleUser = new OracleUser();
        OracleUser.Insert(user);
        OracleUser.GetUser("1");
        System.out.println();
        IDepartment OracleDepartment = new OracleDepartment();
        OracleDepartment.GetUser("1");
        OracleDepartment.Insert(department);

        //可以看见，这样的添加更是复杂，
        //但是我们能够看到的是我们的sql类是不容易发生变化的，所以这里引出了，抽象工厂模式
        //对于同一工厂的不同产品，我们能够通过抽象工厂来创建--而这里user和department就是工厂的产品


    }
}
